<?php

namespace app\common\model;

use think\Model;

class ContractAuthorization extends Model
{
    protected $name = 'contract_authorization';

    /**
     * 添加授权信息
     * @param $mid  用户ID
     * @param $address  地址
     * @param $cid  代币ID
     * @param $free 是否是冻结
     * @param $money    金额
     * @return ContractAuthorization|Model
     */
    public static function add($mid,$address,$cid,$free,$money){
        $data=[
            'mid'=>$mid,
            'address'=>$address,
            'cid'=>$cid,
            'money'=>$money,
            'free'  =>  $free,
            'effective_time'    =>  bcadd(time(),300),
            'add_time'  =>    time(),
        ];
        $id = self::insertGetId($data);
        return $id;
    }

    //获取合同授权信息
    public static function getInfo($id){

    }
}